package com.ruoyi.applet.domain;

import com.ruoyi.common.core.annotation.Excel;
import nonapi.io.github.classgraph.json.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;


import java.math.BigDecimal;

/**
 * 商品对象 goods
 * 
 * @author ruoyi
 * @date 2024-11-11
 */
@Document(indexName = "goods")
public class GoodsDoc
{

    /** 商品唯一标识 */
    @Id
    @Field(name = "goods_id",store = true,index = false,type = FieldType.Integer)
    private Long goodsId;

    private String id;

    public GoodsDoc() {
    }

    public GoodsDoc(Goods goods) {
        this.goodsId = goods.getGoodsId();
        this.id = id;
        this.goodsName = goods.getGoodsName();
        this.goodsInfo = goods.getGoodsInfo();
        this.goodsPrice = goods.getGoodsPrice();
        this.goodsImgId = goods.getGoodsImgId();
        this.goodsShopId = goods.getGoodsShopId();
        this.goodsNum = goods.getGoodsNum();
        this.goodsStatus = goods.getGoodsStatus();
        this.goodsDecimal = goods.getGoodsDecimal();
        this.categoryId = goods.getCategoryId();
    }

    // getter 和 setter 方法
    public String getId() { return id; }
    public void setId(String id) { this.id = id; }
    /** 商品名称 */

    @Excel(name = "商品名称")
    @Field(index=true,name = "goods_name" ,analyzer="ik_smart",store=true,searchAnalyzer="ik_smart",type = FieldType.Text)
    private String goodsName;

    /** 商品介绍 */
    @Excel(name = "商品介绍")
    @Field(index=true,name = "goods_info",analyzer="ik_smart",store=true,searchAnalyzer="ik_smart",type = FieldType.Text)
    private String goodsInfo;

    /** 商品价格 */
    @Excel(name = "商品价格")
    @Field(index=true,name="goods_price",analyzer="ik_smart",store=true,searchAnalyzer="ik_smart",type = FieldType.Integer)
    private BigDecimal goodsPrice;

    /** 商品图片路径 */
    @Excel(name = "商品图片路径")
    @Field(index=true,name="goods_img_id",analyzer="ik_smart",store=true,searchAnalyzer="ik_smart",type = FieldType.Integer)
    private Long goodsImgId;

    /** 商家外键id */
    @Excel(name = "商家外键id")
    @Field(index=true,name="goods_shop_Id",analyzer="ik_smart",store=true,searchAnalyzer="ik_smart",type = FieldType.Integer)
    private Long goodsShopId;

    /** 商品库存 */
    @Excel(name = "商品库存")
    @Field(index=true,name="goods_num",analyzer="ik_smart",store=true,searchAnalyzer="ik_smart",type = FieldType.Integer)
    private Long goodsNum;

    /** 商品状态(上架,下架) */
    @Excel(name = "商品状态(上架,下架)")
    @Field(index=true,name="goods_status",analyzer="ik_smart",store=true,searchAnalyzer="ik_smart",type = FieldType.Integer)
    private Long goodsStatus;

    @Excel(name = "小数")
    @Field(index = true,name = "goods_decimal",analyzer = "ik_smart",store = true,searchAnalyzer = "ik_smart",type = FieldType.Text)
    private String goodsDecimal;


    /** 所属分类 */
    @Excel(name = "所属分类")
    @Field(index = true,name = "goods_category_id",analyzer = "ik_smart",store = true,searchAnalyzer = "ik_smart",type = FieldType.Long)
    private Long categoryId;


    /**
     * 获取
     * @return goods_id
     */
    public Long getGoodsId() {
        return goodsId;
    }

    /**
     * 设置
     * @param goods_id
     */
    public void setGoodsId(Long goods_id) {
        this.goodsId = goods_id;
    }

    /**
     * 获取
     * @return goodsName
     */
    public String getGoodsName() {
        return goodsName;
    }

    /**
     * 设置
     * @param goodsName
     */
    public void setGoodsName(String goodsName) {
        this.goodsName = goodsName;
    }

    /**
     * 获取
     * @return goodsInfo
     */
    public String getGoodsInfo() {
        return goodsInfo;
    }

    /**
     * 设置
     * @param goodsInfo
     */
    public void setGoodsInfo(String goodsInfo) {
        this.goodsInfo = goodsInfo;
    }

    /**
     * 获取
     * @return goodsPrice
     */
    public BigDecimal getGoodsPrice() {
        return goodsPrice;
    }

    /**
     * 设置
     * @param goodsPrice
     */
    public void setGoodsPrice(BigDecimal goodsPrice) {
        this.goodsPrice = goodsPrice;
    }

    /**
     * 获取
     * @return goodsImgId
     */
    public Long getGoodsImgId() {
        return goodsImgId;
    }

    /**
     * 设置
     * @param goodsImgId
     */
    public void setGoodsImgId(Long goodsImgId) {
        this.goodsImgId = goodsImgId;
    }

    /**
     * 获取
     * @return goodsShopId
     */
    public Long getGoodsShopId() {
        return goodsShopId;
    }

    /**
     * 设置
     * @param goodsShopId
     */
    public void setGoodsShopId(Long goodsShopId) {
        this.goodsShopId = goodsShopId;
    }

    /**
     * 获取
     * @return goodsNum
     */
    public Long getGoodsNum() {
        return goodsNum;
    }

    /**
     * 设置
     * @param goodsNum
     */
    public void setGoodsNum(Long goodsNum) {
        this.goodsNum = goodsNum;
    }

    /**
     * 获取
     * @return goodsStatus
     */
    public Long getGoodsStatus() {
        return goodsStatus;
    }

    /**
     * 设置
     * @param goodsStatus
     */
    public void setGoodsStatus(Long goodsStatus) {
        this.goodsStatus = goodsStatus;
    }

    /**
     * 获取
     * @return goodsDecimal
     */
    public String getGoodsDecimal() {
        return goodsDecimal;
    }

    /**
     * 设置
     * @param goodsDecimal
     */
    public void setGoodsDecimal(String goodsDecimal) {
        this.goodsDecimal = goodsDecimal;
    }

    /**
     * 获取
     * @return categoryId
     */
    public Long getCategoryId() {
        return categoryId;
    }

    /**
     * 设置
     * @param categoryId
     */
    public void setCategoryId(Long categoryId) {
        this.categoryId = categoryId;
    }

    public String toString() {
        return "GoodsDoc{goods_id = " + goodsId + ", id = " + id + ", goodsName = " + goodsName + ", goodsInfo = " + goodsInfo + ", goodsPrice = " + goodsPrice + ", goodsImgId = " + goodsImgId + ", goodsShopId = " + goodsShopId + ", goodsNum = " + goodsNum + ", goodsStatus = " + goodsStatus + ", goodsDecimal = " + goodsDecimal + ", categoryId = " + categoryId + "}";
    }
}
